package chapter19.h19_3;

public class NoonState implements State{
    private static NoonState singleton = new NoonState();
    private NoonState(){

    }
    public static NoonState getInstance(){
        return singleton;
    }

    public void doClock(Context context, int hour){
        if(hour < 9 || hour >= 17){
            context.changeState(NightState.getInstance());
        }else if(hour >= 9 && hour < 12 || hour >= 13 && hour < 17){
            context.changeState(DayState.getInstance());
        }
    }
    //下面是调用使用金库，按警铃的操作，没大的改变
}
